<?php

/**
 * sfGuardUserProfile form.
 *
 * @package    CeeVee
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class sfGuardUserProfileForm extends BasesfGuardUserProfileForm
{
  public function configure()
  {
      $this->useFields(array('user_id','firstname', 'lastname', 'birthday','gender_id', 'user_picture',));
      //$this->embedI18n(array('de', 'en'));
      
     // $this->setWidget('user_picture', new sfWidgetFormInputFile());
     // $this->setValidator('user_picture', new sfValidatorFile(array(
     // 'mime_types' => 'web_images',
     // 'path' => sfConfig::get('sf_upload_dir').'/images',       
          
     //  )));
      
      $this->widgetSchema['user_picture'] = new sfWidgetFormInputFileEditable(array(
      'label'     => 'User Picture',
      'file_src'  => '/uploads/images/'.$this->getObject()->getUserPicture(),
      'is_image'  => true,
      'edit_mode' => !$this->isNew(),
      'template'  => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>',
      'with_delete' => true,
    ));
 
    $this->validatorSchema['user_picture'] = new sfValidatorFile(array(
  'required'        => false,
  'path'            => sfConfig::get('sf_upload_dir').'/images/',
  'mime_types' => 'web_images'
));
    $this->validatorSchema['user_picture_delete'] = new sfValidatorPass();
  }
}
